package com.iv.durian.cloud.facade;

import com.iv.durian.cloud.Serve;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Component
@FeignClient(name = Serve.SERVICE_NAME)
@RequestMapping("/service/random")
public interface RandomCodeFacade {

    @RequestMapping(value = "/code/{userKey}", method = RequestMethod.GET)
    String generateCode(@PathVariable( "userKey")String key);

    @RequestMapping(value = "/verify/{userKey}/{code}", method = RequestMethod.GET)
    boolean verifyCode(@PathVariable( "userKey")String key,@PathVariable( "code")String code);
}
